{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal='{:url("add")}' data-title="添加分类">添加分类</button>
<!--{/if}-->

<!--{if auth("remove")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-action='{:url("remove")}' data-rule="id#{key}">删除分类</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-shadow">
    <div class="layui-tab-content">
        {include file='kitchen_tool/search'}
        <table id="BaseData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
    </div>
    {notempty name='list'}
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button class="layui-btn layui-btn-xs" data-reload type="button">刷 新</button>
            </th>
            <th class='text-center'></th>
            <th colspan="3"></th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.ids}'></label>
            </td>
            <td class="nowrap"><span class="color-desc notselect">{$vo.spl|raw}</span>{$vo.name}</td>
            <td class="color-desc">库存：{$vo.stock|default=''}</td>
            <td class='text-center nowrap'>{eq name='vo.is_deleted' value='1'}<span class="color-red">已删除</span>{else}<span class="color-green">正常</span>{/eq}</td>
            <td class='text-center nowrap notselect'>

                <!--{if auth("edit")}-->
                <a class="layui-btn layui-btn-xs" data-dbclick data-modal='{:url("edit")}?id={$vo.id}' data-title="编辑分类">编 辑</a>
                <!--{/if}-->

                <!--{if auth("remove")}-->
                <a class="layui-btn layui-btn-danger layui-btn-xs" data-action="{:url('remove')}" data-confirm="确定要删除数据吗?" data-csrf="{:systoken('remove')}" data-value="id#{$vo.ids}">删 除</a>
                <!--{/if}-->

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {$pagehtml|raw|default=''}
    {else}
    <span class="notdata">没有记录哦</span>
    {/notempty}
</div>
{/block}